package com.itheima.d4_byte__stream;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class FileInputStreamTest4 {
    public static void main(String[] args) throws Exception {
        //创建文件字节输入流管道
        //覆盖管道
//        OutputStream fileOutputStream = new FileOutputStream("D:\\Java\\JavaEE_learn\\IO_learn\\src\\main\\java\\com\\itheima\\itheima04out.txt");
        OutputStream fileOutputStream = new FileOutputStream
                ("D:\\Java\\JavaEE_learn\\IO_learn\\src\\main\\java\\com\\itheima\\itheima04out.txt",true);

        //2,开始写字节数据
        fileOutputStream.write(97);
        fileOutputStream.write('b');
//        fileOutputStream.write('嘞');

        byte[] bytes = "我爱你中国88".getBytes();
        fileOutputStream.write(bytes);

        fileOutputStream.write(bytes,0,15);
        //换行符
        fileOutputStream.write("\r\n".getBytes());
        fileOutputStream.close();
    }
}
